/*
 * HorarioProfesional.java
 *
 * Created on 4 de octubre de 2008, 23:11
 */

package podologia;

import java.util.Iterator;
import javax.persistence.EntityTransaction;
import javax.swing.JComboBox;
import javax.swing.JOptionPane;
import org.jdesktop.beansbinding.Binding;
import org.jdesktop.beansbinding.BindingGroup;
import podologia.beans.InfoHora;
import podologia.beansDB.Diaatencion;

/**
 *
 * @author  Hernan
 */
public class HorarioProfesional extends javax.swing.JInternalFrame {

    private InfoHora[] hora = new InfoHora[61];
     private long[] dur = new long[61];
    /** Creates new form HorarioProfesional */
    public HorarioProfesional() {
        initComponents();
        initComboHora(jComboBox2);
        initComboHora(jComboBox3);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

        PodologiaPUEntityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory("PodologiaPU").createEntityManager();
        empleadoQuery = java.beans.Beans.isDesignTime() ? null : PodologiaPUEntityManager.createQuery("SELECT e FROM Empleado e");
        empleadoList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : empleadoQuery.getResultList();
        diaatencionQuery = java.beans.Beans.isDesignTime() ? null : PodologiaPUEntityManager.createQuery("SELECT d FROM Diaatencion d");
        diaatencionList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : diaatencionQuery.getResultList();
        jLabel1 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTableEmpleadop = new javax.swing.JTable();
        jLabel3 = new javax.swing.JLabel();
        jComboBox1 = new javax.swing.JComboBox();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jComboBox2 = new javax.swing.JComboBox();
        jComboBox3 = new javax.swing.JComboBox();
        jButton1 = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTableHorario = new javax.swing.JTable();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(podologia.PodologiaApp.class).getContext().getResourceMap(HorarioProfesional.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setName("Form"); // NOI18N

        jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N
        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        jTextField1.setText(resourceMap.getString("jTextField1.text")); // NOI18N
        jTextField1.setName("jTextField1"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jTableEmpleadop.setName("jTableEmpleadop"); // NOI18N

        org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, empleadoList, jTableEmpleadop);
        org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${nombreCompleto}"));
        columnBinding.setColumnName("Nombre Completo");
        columnBinding.setColumnClass(String.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${idPersona.nroDoc}"));
        columnBinding.setColumnName("Id Persona.nro Doc");
        columnBinding.setColumnClass(Double.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${legajo}"));
        columnBinding.setColumnName("Legajo");
        columnBinding.setColumnClass(Integer.class);
        bindingGroup.addBinding(jTableBinding);
        jTableBinding.bind();
        jTableEmpleadop.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTableEmpleadopMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(jTableEmpleadop);
        jTableEmpleadop.getColumnModel().getColumn(0).setHeaderValue(resourceMap.getString("jTableEmpleadop.columnModel.title0")); // NOI18N
        jTableEmpleadop.getColumnModel().getColumn(1).setHeaderValue(resourceMap.getString("jTableEmpleadop.columnModel.title1")); // NOI18N
        jTableEmpleadop.getColumnModel().getColumn(2).setHeaderValue(resourceMap.getString("jTableEmpleadop.columnModel.title2")); // NOI18N

        jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        jLabel3.setName("jLabel3"); // NOI18N

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado" }));
        jComboBox1.setName("jComboBox1"); // NOI18N

        jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
        jLabel4.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        jLabel4.setName("jLabel4"); // NOI18N

        jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        jLabel5.setName("jLabel5"); // NOI18N

        jComboBox2.setName("jComboBox2"); // NOI18N

        jComboBox3.setName("jComboBox3"); // NOI18N

        jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
        jButton1.setName("jButton1"); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jScrollPane2.setName("jScrollPane2"); // NOI18N
        jScrollPane2.setPreferredSize(new java.awt.Dimension(452, 200));

        jTableHorario.setName("jTableHorario"); // NOI18N

        jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, diaatencionList, jTableHorario);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${dia}"));
        columnBinding.setColumnName("Dia");
        columnBinding.setColumnClass(Integer.class);
        columnBinding.setEditable(false);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${horaInicio}"));
        columnBinding.setColumnName("Hora Inicio");
        columnBinding.setColumnClass(Long.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${horaFin}"));
        columnBinding.setColumnName("Hora Fin");
        columnBinding.setColumnClass(Long.class);
        columnBinding.setEditable(false);
        bindingGroup.addBinding(jTableBinding);
        jTableBinding.bind();
        jScrollPane2.setViewportView(jTableHorario);
        jTableHorario.getColumnModel().getColumn(0).setHeaderValue(resourceMap.getString("jTableHorario.columnModel.title0")); // NOI18N
        jTableHorario.getColumnModel().getColumn(0).setCellRenderer(new DateRenderer(3));
        jTableHorario.getColumnModel().getColumn(1).setHeaderValue(resourceMap.getString("jTableHorario.columnModel.title1")); // NOI18N
        jTableHorario.getColumnModel().getColumn(1).setCellRenderer(new DateRenderer(4));
        jTableHorario.getColumnModel().getColumn(2).setHeaderValue(resourceMap.getString("jTableHorario.columnModel.title2")); // NOI18N
        jTableHorario.getColumnModel().getColumn(2).setCellRenderer(new DateRenderer(4));

        jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N
        jButton2.setName("jButton2"); // NOI18N
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setText(resourceMap.getString("jButton3.text")); // NOI18N
        jButton3.setName("jButton3"); // NOI18N
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jButton3))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 262, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 641, Short.MAX_VALUE)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                            .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jLabel5))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                            .addComponent(jComboBox3, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jComboBox2, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jComboBox1, javax.swing.GroupLayout.Alignment.LEADING, 0, 128, Short.MAX_VALUE)
                                            .addComponent(jButton1)))
                                    .addComponent(jButton2))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))))
                .addGap(64, 64, 64))
        );

        layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jButton1, jButton2});

        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(59, 59, 59)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel3))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel5))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton1)
                        .addGap(18, 18, 18)
                        .addComponent(jButton2))
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 112, Short.MAX_VALUE)
                .addComponent(jButton3)
                .addContainerGap())
        );

        bindingGroup.bind();

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-800)/2, (screenSize.height-600)/2, 800, 600);
    }// </editor-fold>//GEN-END:initComponents

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
dispose();// TODO add your handling code here:
}//GEN-LAST:event_jButton3ActionPerformed

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
   Diaatencion d=new Diaatencion();
   d.setDia(jComboBox1.getSelectedIndex()+1);
   d.setHoraFin(((InfoHora)jComboBox3.getSelectedItem()).getHora());
   d.setHoraInicio(((InfoHora)jComboBox2.getSelectedItem()).getHora());
    EntityTransaction tx = PodologiaPUEntityManager.getTransaction();
   tx.begin();
        PodologiaPUEntityManager.persist(d);
    tx.commit();
    diaatencionQuery=PodologiaPUEntityManager.createQuery("SELECT d FROM Diaatencion d WHERE d.idEmpleado=:emp" );
diaatencionQuery.setParameter("emp", empleadoList.get(jTableEmpleadop.getSelectedRow()));
diaatencionList.clear();
diaatencionList.addAll(diaatencionQuery.getResultList());
jTableHorario.updateUI();
jTableHorario.repaint();
}//GEN-LAST:event_jButton1ActionPerformed

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
  Diaatencion d=new Diaatencion();
   d=diaatencionList.get(jTableHorario.getSelectedRow());
   EntityTransaction tx = PodologiaPUEntityManager.getTransaction();
   tx.begin();
        PodologiaPUEntityManager.remove(d);
    tx.commit();
    diaatencionList.clear();
    diaatencionQuery=PodologiaPUEntityManager.createQuery("SELECT d FROM Diaatencion d WHERE d.idEmpleado=:emp" );
diaatencionQuery.setParameter("emp", empleadoList.get(jTableEmpleadop.getSelectedRow()));
cargarjTable();
}//GEN-LAST:event_jButton2ActionPerformed

private void jTableEmpleadopMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTableEmpleadopMouseClicked
diaatencionQuery=PodologiaPUEntityManager.createQuery("SELECT d FROM Diaatencion d WHERE d.idEmpleado=:emp" );
diaatencionQuery.setParameter("emp", empleadoList.get(jTableEmpleadop.getSelectedRow()));
cargarjTable();
}//GEN-LAST:event_jTableEmpleadopMouseClicked

public void cargarjTable(){

        try {
            Binding b = findBinding(bindingGroup, diaatencionList, jTableHorario);
            b.unbind();
            diaatencionList.clear();
            diaatencionList.addAll(diaatencionQuery.getResultList());
            b.bind();
            jTableHorario.repaint();
        } catch (Exception e) {
            JOptionPane.showMessageDialog(null, "Error" + e.getMessage());

        }


    diaatencionList.clear();
    diaatencionList.addAll(diaatencionQuery.getResultList());
    jTableHorario.updateUI();
    jTableHorario.repaint();

}

    public Binding findBinding(BindingGroup bindingGroup, Object source, Object target) {
        for (Iterator<Binding> i = bindingGroup.getBindings().iterator(); i.hasNext();) {
            Binding b = i.next();
            boolean found =
                    (source == null || b.getSourceObject() == source) &&
                    (target == null || b.getTargetObject() == target);
            if (found) {
                return b;
            }

        }
        return null;
    }


private void initComboHora (JComboBox jComboBoxHorarioTurno) {
for (int i=0;i<61;i++) hora[i]=new InfoHora();
     for (int i=0;i<61;i++){
        dur[i]=(i*900000)+25200000;
       //System.out.println(dur[i]);
    }

     hora[0].setTexthora("07:00");
     hora[0].setHora(dur[0]);
     jComboBoxHorarioTurno.addItem(hora[0]);
     hora[1].setTexthora("07:15");
     hora[1].setHora(dur[1]);
     jComboBoxHorarioTurno.addItem(hora[1]);
     hora[2].setTexthora("07:30");
     hora[2].setHora(dur[2]);
     jComboBoxHorarioTurno.addItem(hora[2]);
     hora[3].setTexthora("07:45");
     hora[3].setHora(dur[3]);
     jComboBoxHorarioTurno.addItem(hora[3]);
     hora[4].setTexthora("08:00");
     hora[4].setHora(dur[4]);
     jComboBoxHorarioTurno.addItem(hora[4]);
     hora[5].setTexthora("08:15");
     hora[5].setHora(dur[5]);
     jComboBoxHorarioTurno.addItem(hora[5]);
     hora[6].setTexthora("08:30");
     hora[6].setHora(dur[6]);
     jComboBoxHorarioTurno.addItem(hora[6]);
     hora[7].setTexthora("08:45");
     hora[7].setHora(dur[7]);
     jComboBoxHorarioTurno.addItem(hora[7]);
     hora[8].setTexthora("09:00");
     hora[8].setHora(dur[8]);
     jComboBoxHorarioTurno.addItem(hora[8]);
     hora[9].setTexthora("09:15");
     hora[9].setHora(dur[9]);
     jComboBoxHorarioTurno.addItem(hora[9]);
     hora[10].setTexthora("09:30");
     hora[10].setHora(dur[10]);
     jComboBoxHorarioTurno.addItem(hora[10]);
     hora[11].setTexthora("09:45");
     hora[11].setHora(dur[11]);
     jComboBoxHorarioTurno.addItem(hora[11]);
     hora[12].setTexthora("10:00");
     hora[12].setHora(dur[12]);
     jComboBoxHorarioTurno.addItem(hora[12]);
     hora[13].setTexthora("10:15");
     hora[13].setHora(dur[13]);
     jComboBoxHorarioTurno.addItem(hora[13]);
     hora[14].setTexthora("10:30");
     hora[14].setHora(dur[14]);
     jComboBoxHorarioTurno.addItem(hora[14]);
     hora[15].setTexthora("10:45");
     hora[15].setHora(dur[15]);
     jComboBoxHorarioTurno.addItem(hora[15]);
     hora[16].setTexthora("11:00");
     hora[16].setHora(dur[16]);
     jComboBoxHorarioTurno.addItem(hora[16]);
     hora[17].setTexthora("11:15");
     hora[17].setHora(dur[17]);
     jComboBoxHorarioTurno.addItem(hora[17]);
     hora[18].setTexthora("11:30");
     hora[18].setHora(dur[18]);
     jComboBoxHorarioTurno.addItem(hora[18]);
     hora[19].setTexthora("11:45");
     hora[19].setHora(dur[19]);
     jComboBoxHorarioTurno.addItem(hora[19]);
     hora[20].setTexthora("12:00");
     hora[20].setHora(dur[20]);
     jComboBoxHorarioTurno.addItem(hora[20]);
     hora[21].setTexthora("12:15");
     hora[21].setHora(dur[21]);
     jComboBoxHorarioTurno.addItem(hora[21]);
     hora[22].setTexthora("12:30");
     hora[22].setHora(dur[22]);
     jComboBoxHorarioTurno.addItem(hora[22]);
     hora[23].setTexthora("12:45");
     hora[23].setHora(dur[23]);
     jComboBoxHorarioTurno.addItem(hora[23]);
     hora[24].setTexthora("13:00");
     hora[24].setHora(dur[24]);
     jComboBoxHorarioTurno.addItem(hora[24]);
     hora[25].setTexthora("13:15");
     hora[25].setHora(dur[25]);
     jComboBoxHorarioTurno.addItem(hora[25]);
     hora[26].setTexthora("13:30");
     hora[26].setHora(dur[26]);
     jComboBoxHorarioTurno.addItem(hora[26]);
     hora[27].setTexthora("13:45");
     hora[27].setHora(dur[27]);
     jComboBoxHorarioTurno.addItem(hora[27]);
     hora[28].setTexthora("14:00");
     hora[28].setHora(dur[28]);
     jComboBoxHorarioTurno.addItem(hora[28]);
     hora[29].setTexthora("14:15");
     hora[29].setHora(dur[29]);
     jComboBoxHorarioTurno.addItem(hora[29]);
     hora[30].setTexthora("14:30");
     hora[30].setHora(dur[30]);
     jComboBoxHorarioTurno.addItem(hora[30]);
     hora[31].setTexthora("14:45");
     hora[31].setHora(dur[31]);
     jComboBoxHorarioTurno.addItem(hora[31]);
     hora[32].setTexthora("15:00");
     hora[32].setHora(dur[32]);
     jComboBoxHorarioTurno.addItem(hora[32]);
     hora[33].setTexthora("15:15");
     hora[33].setHora(dur[33]);
     jComboBoxHorarioTurno.addItem(hora[33]);
     hora[34].setTexthora("15:30");
     hora[34].setHora(dur[34]);
     jComboBoxHorarioTurno.addItem(hora[34]);
     hora[35].setTexthora("15:45");
     hora[35].setHora(dur[35]);
     jComboBoxHorarioTurno.addItem(hora[35]);
     hora[36].setTexthora("16:00");
     hora[36].setHora(dur[36]);
     jComboBoxHorarioTurno.addItem(hora[36]);
     hora[37].setTexthora("16:15");
     hora[37].setHora(dur[37]);
     jComboBoxHorarioTurno.addItem(hora[37]);
     hora[38].setTexthora("16:30");
     hora[38].setHora(dur[38]);
     jComboBoxHorarioTurno.addItem(hora[38]);
     hora[39].setTexthora("16:45");
     hora[39].setHora(dur[39]);
     jComboBoxHorarioTurno.addItem(hora[39]);
     hora[40].setTexthora("17:00");
     hora[40].setHora(dur[40]);
     jComboBoxHorarioTurno.addItem(hora[40]);
     hora[41].setTexthora("17:15");
     hora[41].setHora(dur[41]);
     jComboBoxHorarioTurno.addItem(hora[41]);
     hora[42].setTexthora("17:30");
     hora[42].setHora(dur[42]);
     jComboBoxHorarioTurno.addItem(hora[42]);
     hora[43].setTexthora("17:45");
     hora[43].setHora(dur[43]);
     jComboBoxHorarioTurno.addItem(hora[43]);
     hora[44].setTexthora("18:00");
     hora[44].setHora(dur[44]);
     jComboBoxHorarioTurno.addItem(hora[44]);
     hora[45].setTexthora("18:15");
     hora[45].setHora(dur[45]);
     jComboBoxHorarioTurno.addItem(hora[45]);
     hora[46].setTexthora("18:30");
     hora[46].setHora(dur[46]);
     jComboBoxHorarioTurno.addItem(hora[46]);
     hora[47].setTexthora("18:45");
     hora[47].setHora(dur[47]);
     jComboBoxHorarioTurno.addItem(hora[47]);
     hora[48].setTexthora("19:00");
     hora[48].setHora(dur[48]);
     jComboBoxHorarioTurno.addItem(hora[48]);
     hora[49].setTexthora("19:15");
     hora[49].setHora(dur[49]);
     jComboBoxHorarioTurno.addItem(hora[49]);
     hora[50].setTexthora("19:30");
     hora[50].setHora(dur[50]);
     jComboBoxHorarioTurno.addItem(hora[50]);
     hora[51].setTexthora("19:45");
     hora[51].setHora(dur[51]);
     jComboBoxHorarioTurno.addItem(hora[51]);
     hora[52].setTexthora("20:00");
     hora[52].setHora(dur[52]);
     jComboBoxHorarioTurno.addItem(hora[52]);
     hora[53].setTexthora("20:15");
     hora[53].setHora(dur[53]);
     jComboBoxHorarioTurno.addItem(hora[53]);
     hora[54].setTexthora("20:30");
     hora[54].setHora(dur[54]);
     jComboBoxHorarioTurno.addItem(hora[54]);
     hora[55].setTexthora("20:45");
     hora[55].setHora(dur[55]);
     jComboBoxHorarioTurno.addItem(hora[55]);
     hora[56].setTexthora("21:00");
     hora[56].setHora(dur[56]);
     jComboBoxHorarioTurno.addItem(hora[56]);
     hora[57].setTexthora("21:15");
     hora[57].setHora(dur[57]);
     jComboBoxHorarioTurno.addItem(hora[57]);
     hora[58].setTexthora("21:30");
     hora[58].setHora(dur[58]);
     jComboBoxHorarioTurno.addItem(hora[58]);
     hora[59].setTexthora("21:45");
     hora[59].setHora(dur[59]);
     jComboBoxHorarioTurno.addItem(hora[59]);
     hora[60].setTexthora("22:00");
     hora[60].setHora(dur[60]);
     jComboBoxHorarioTurno.addItem(hora[60]);



}

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.persistence.EntityManager PodologiaPUEntityManager;
    private java.util.List<podologia.beansDB.Diaatencion> diaatencionList;
    private javax.persistence.Query diaatencionQuery;
    private java.util.List<podologia.beansDB.Empleado> empleadoList;
    private javax.persistence.Query empleadoQuery;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JComboBox jComboBox2;
    private javax.swing.JComboBox jComboBox3;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTable jTableEmpleadop;
    private javax.swing.JTable jTableHorario;
    private javax.swing.JTextField jTextField1;
    private org.jdesktop.beansbinding.BindingGroup bindingGroup;
    // End of variables declaration//GEN-END:variables

}
